package com.twu.biblioteca.view.console.ui_element;

import com.twu.biblioteca.view.command.Command;
import com.twu.biblioteca.view.console.ConsoleViewController;

public class MenuItem {
  private final String itemTitle;
  private final Command command;

  public MenuItem(String itemTitle, Command command) {
    this.itemTitle = itemTitle;
    this.command = command;
  }

  public Object getTitle() {
    return itemTitle;
  }

  public void selected(ConsoleViewController viewController) {
    this.command.execute(viewController);
  }
}
